﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
	x:Class="SmartCA.Presentation.Views.ProjectContactView"
	xmlns:viewModel="clr-namespace:SmartCA.Presentation.ViewModels"
	xmlns:presentation="clr-namespace:SmartCA.Presentation.Views"
	Title="Project Contacts"
	x:Name="projectContactsWindow"
	Width="800" Height="600" Background="{StaticResource FormBackgroundBrush}">
	
  <Grid>
  
	<Grid.RowDefinitions>
	  <RowDefinition Height="Auto" />
	  <RowDefinition />
	  <RowDefinition Height="Auto" />
	</Grid.RowDefinitions>
	<Grid.ColumnDefinitions>
	  <ColumnDefinition Width="1*" />
	  <ColumnDefinition Width="2*" />
	</Grid.ColumnDefinitions>
	
	<Label Style="{StaticResource headerLabelStyle}" Margin="10" Grid.Row="0" Grid.Column="0">Project Contacts</Label>
	<Label Style="{StaticResource headerLabelStyle}" Margin="0,10,10,10" Grid.Row="0" Grid.Column="1">Selected Contact</Label>
	
	<ListBox Margin="10,0,10,10" Grid.Row="1" Grid.Column="0" 
		IsSynchronizedWithCurrentItem="True" 
		SelectedItem="{Binding Path=CurrentEntity}"
		ItemsSource="{Binding Path=EntitiesView}"
		DisplayMemberPath="Contact.LastName"/>
		
	<Border BorderBrush="Black" BorderThickness="1" Margin="0,0,10,10" Grid.Row="1" Grid.Column="1">
		<ScrollViewer>
			<Grid>
			
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>
				
				<Label Grid.Row="0" Grid.Column="0" Content="First Name:" 
					Style="{StaticResource baseLabelStyle}"/>
				<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=CurrentEntity.Contact.FirstName}"/>
				
				<Label Grid.Row="1" Grid.Column="0" Content="Last Name:"
					Style="{StaticResource baseLabelStyle}"/>
				<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=CurrentEntity.Contact.LastName}"/>
				
				<Label Grid.Row="2" Grid.Column="0" Content="Initials:"
					Style="{StaticResource baseLabelStyle}"/>
				<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Path=CurrentEntity.Contact.Initials}"/>
				
				<Label Grid.Row="3" Grid.Column="0" Content="Job Title:"
					Style="{StaticResource baseLabelStyle}"/>
				<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding Path=CurrentEntity.Contact.JobTitle}"/>
				
				<Label Grid.Row="4" Grid.Column="0" Content="Address Info:"
					Style="{StaticResource baseLabelStyle}"/>
				<presentation:Addresses Grid.Row="4" Grid.Column="1" DataContext="{Binding Path=Addresses}"/>
					
				<Label Grid.Row="5" Grid.Column="0" Content="Company:" 
					Style="{StaticResource baseLabelStyle}"/>
				<ComboBox Grid.Row="5" Grid.Column="1"
					SelectedItem="{Binding Path=CurrentEntity.Contact.CurrentCompany}"
					DisplayMemberPath="Name"
					ItemsSource="{Binding Path=Companies}">				
				</ComboBox>
				
				<Label Grid.Row="6" Grid.Column="0" Content="Email:" 
					Style="{StaticResource baseLabelStyle}"/>
				<TextBox Grid.Row="6" Grid.Column="1" 
					Text="{Binding Path=CurrentEntity.Contact.Email}"/>
				
				<Label Grid.Row="7" Grid.Column="0" Content="Phone Number:" 
					Style="{StaticResource baseLabelStyle}"/>
				<TextBox Grid.Row="7" Grid.Column="1" 
					Text="{Binding Path=CurrentEntity.Contact.PhoneNumber}"/>
					
				<Label Grid.Row="8" Grid.Column="0" Content="Mobile Phone Number:" 
					Style="{StaticResource baseLabelStyle}"/>
				<TextBox Grid.Row="8" Grid.Column="1" 
					Text="{Binding Path=CurrentEntity.Contact.MobilePhoneNumber}"/>
					
				<Label Grid.Row="9" Grid.Column="0" Content="Fax Number:"
					Style="{StaticResource baseLabelStyle}"/>
				<TextBox Grid.Row="9" Grid.Column="1" 
					Text="{Binding Path=CurrentEntity.Contact.FaxNumber}"/>
					
				<Label Grid.Row="10" Grid.Column="0" Content="Final Distribution:"
					Style="{StaticResource baseLabelStyle}"/>
				<CheckBox Grid.Row="10" Grid.Column="1" IsThreeState="False"
					IsChecked="{Binding Path=CurrentEntity.OnFinalDistributionList}"/>
					
				<Label Grid.Row="11" Grid.Column="0" Content="Remarks:"
					Style="{StaticResource baseLabelStyle}"/>
				<TextBox Grid.Row="11" Grid.Column="1" 
					Text="{Binding Path=CurrentEntity.Contact.Remarks}"
					TextWrapping="Wrap"/>
        </Grid>
	  </ScrollViewer>
	</Border>
	
	<Button HorizontalAlignment="Right" Margin="10,0,10,10" Grid.Row="2" Grid.Column="0" Command="{Binding Path=NewCommand}">New</Button>
	<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="2" Grid.Column="1">
	  <Button Grid.Row="2" Margin="10,0,10,10" Grid.Column="0" Command="{Binding Path=SaveCommand}">Save</Button>
	  <Button Grid.Row="2" Margin="0,0,10,10" Grid.Column="0" Command="{Binding Path=CancelCommand}">Cancel</Button>
	</StackPanel>

  </Grid>
  
</Window>

